/**
 * @Description 教师评价得分记录Dao
 * @author 20155872 游宇
 * @create 2018-05-16 21:01
 **/

package com.campus_information_portal.dao;

import com.campus_information_portal.entity.TeacherGrade;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @className TeacherGradeDao
 * @Description 教师评价得分记录Dao
 * @author 20155872 游宇
 * @create 2018-05-16 21:01
 **/
public interface TeacherGradeDao {

    /**
     * @Description: 新增一条教师得分记录
     * @author: 20155872 游宇
     * @methodName: addTeacherGrade
     * @param: TeacherGrade teacherGrade
     * @returnType: boolean
     * @createTime: 2018/5/16 21:07
     **/
    @Insert("insert into teacher_grade(te_info_id,term_id,tg_grade) values(#{teInfoId},#{termId},#{tgGrade})")
    public boolean addTeacherGrade(TeacherGrade teacherGrade);

    /**
     * @Description: 根据教师信息id和学期id 查询教师得分记录
     * @author: 20155872 游宇
     * @methodName: TeacherGrade
     * @param: int teInfoId,int termId
     * @returnType: TeacherGrade
     * @createTime: 2018/5/16 21:13
     **/
    @Select("select * from teacher_grade where te_info_id=#{teInfoId} and term_id=#{termId}")
    public TeacherGrade getTeacherGrade(@Param("teInfoId") int teInfoId,@Param("termId") int termId);



    /**
     * @Description: 根据学期id查询该学期所有老师的评价得分情况
     * @author: 20155872 游宇
     * @methodName: getAllTeacherGradeBytermId
     * @param: int termId
     * @returnType: List<TeacherGrade>
     * @createTime: 2018/5/17 8:11
     **/
    @Select("select * from teacher_grade where term_id=#{termId}")
    public List<TeacherGrade> getAllTeacherGradeBytermId(@Param("termId") int termId);

}
